package transactionimplementation

import (
	AbstractTransactions "SoftwareEngineering/AbstractTransactions"
	Model "SoftwareEngineering/Model"
	ModelImplementation "SoftwareEngineering/ModelImplementation"
	DataBase "SoftwareEngineering/DataBase"
)

type ChangeMemberTransaction struct {
	AbstractTransactions.ChangeAffiliationTransaction
	itsMemberId int64
	itsDues float64
}

func (c *ChangeMemberTransaction) RecordMembership(employee  Model.Employee) {
	DataBase.PayrollDatabase.Default.AddUnionMember(c.itsMemberId, employee)
}

func (c *ChangeMemberTransaction) GetAffiliation() Model.Affiliation{
	return ModelImplementation.UnionAffiliation(c.itsDues, c.itsMemberId)
}
